/*
 * Exploder
 * 
 * Tero Pyylampi (218437), Jussi Tuurinkoski (211594)
 *
 * Scene to display splash image + loading screen
 */

#ifndef SPLASHSCENE_H
#define SPLASHSCENE_H

#include "cocos2d.h"

class MainEngine;
class SplashLayer;

class SplashScene : public cocos2d::CCScene
{
public:
	// default constructor
	SplashScene( MainEngine *mainEngine );
	// default destructor
	~SplashScene();

	// initialize this scene
	void initScene();

	// update -function
	virtual void update( cocos2d::ccTime dt );
	
	// get master
	MainEngine *getMaster();

	// loading callback
	void loadingCallback( cocos2d::CCObject *pSender );

private:
	// pointer to the master engine
	MainEngine *mMaster;
	// layer included
	SplashLayer *mSplashLayer;

	// time left in this scene
	float mTimeLeft;
	// whether we have started loading the resources
	bool mLoadingResources;
	// whether the loading is complete
	volatile bool mLoadingComplete;

	// loading function for the resources
	void loadResources();
};

#endif